# -*- coding: utf-8 -*-
from rest_framework import serializers
from .models import *


class PurchaseSerializer(serializers.ModelSerializer):
    class Meta:
        model = Purchase
        fields = '__all__'


class GoodInPurchaseSerializer(serializers.ModelSerializer):
    class Meta:
        model = GoodInPurchase
        fields = '__all__'


class SaleSerializer(serializers.ModelSerializer):
    class Meta:
        model = Sale
        fields = '__all__'


class GoodInSaleSerializer(serializers.ModelSerializer):
    class Meta:
        model = GoodInSale
        # fields = ('album_name', 'artist', 'tracks')
        fields = '__all__'


class SaleCommentSerializer(serializers.ModelSerializer):
    class Meta:
        model = SaleComment
        fields = '__all__'


class GoodCommentSerializer(serializers.ModelSerializer):
    class Meta:
        model = GoodComment
        fields = '__all__'


class RefundSerializer(serializers.ModelSerializer):
    class Meta:
        model = Refund
        fields = '__all__'


class SaleWithGoodInSaleSerializer(serializers.ModelSerializer):
    sale_goodinsale = GoodInSaleSerializer(many=True)
    class Meta:
        model = Sale
        fields = '__all__'


class GoodInSaleWithDetailedSaleSerializer(serializers.ModelSerializer):
    fk_sale = SaleSerializer()
    class Meta:
        model = GoodInSale
        fields = '__all__'


class PurChaseWithGoodInPurchaseSerializer(serializers.ModelSerializer):
    purchase_goodinpurchase = GoodInPurchaseSerializer(many=True)
    class Meta:
        model = Purchase
        fields = '__all__'


class GoodInPurchaseWithDetailedPurchaseSerializer(serializers.ModelSerializer):
    fk_purchase = PurchaseSerializer()
    class Meta:
        model = GoodInPurchase
        fields = '__all__'
